package com.mjsoftking.palettelib.bean;

import androidx.annotation.NonNull;

/**
 * 用途：
 * <p>
 * 作者：MJSoftKing
 */
public class PalettePoint {

    public float x;
    public float y;

    public PalettePoint() {
    }

    public PalettePoint(float x, float y) {
        this.x = x;
        this.y = y;
    }

    @NonNull
    @Override
    public PalettePoint clone() {
        return new PalettePoint(x, y);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PalettePoint)) return false;
        PalettePoint point = (PalettePoint) o;
        return Float.compare(point.x, x) == 0 &&
                Float.compare(point.y, y) == 0;
    }

    @Override
    public int hashCode() {
        return Float.floatToIntBits(x) + Float.floatToIntBits(y);
    }
}
